package schema

import (
	"entgo.io/ent"
	"entgo.io/ent/dialect"
	"entgo.io/ent/schema/field"
)

// EntAdmin holds the schema definition for the EntAdmin entity.
type EntAdmin struct {
	ent.Schema
}

// Fields of the EntAdmin.
func (EntAdmin) Fields() []ent.Field {

	return []ent.Field{

		field.Int32("id").SchemaType(map[string]string{
			dialect.MySQL: "int(10)unsigned", // Override MySQL.
		}).Comment("自增Id").Unique(),

		field.String("name").SchemaType(map[string]string{
			dialect.MySQL: "varchar(255)", // Override MySQL.
		}).Optional().Default("").Comment("名字"),

		field.Int32("age").SchemaType(map[string]string{
			dialect.MySQL: "int(10)unsigned", // Override MySQL.
		}).Optional().Default(0).Comment("年龄"),
	}

}

// Edges of the EntAdmin.
func (EntAdmin) Edges() []ent.Edge {
	return nil
}
